package com.dbdata.move.model;

// Generated cafuc by Hibernate Tools 4

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * TrainNoticePart generated by hbm2java
 */
@Entity
@Table(name = "train_notice_part")
public class TrainNoticePart implements java.io.Serializable {

	private Long id;
	private Organize organize;
	private TrainNotice trainNotice;
	private Date begintime;
	private Date endtime;
	private Byte state;
	private Set<TrainNoticePartUserBaseInfo> trainNoticePartUserBaseInfos = new HashSet<TrainNoticePartUserBaseInfo>(
			0);
	private Set<Teacher> teachers = new HashSet<Teacher>(0);
	private Set<MessageRelatedPerson> messageRelatedPersons = new HashSet<MessageRelatedPerson>(
			0);
	private Set<TrainNoticeBrigadeDoubleSelect> trainNoticeBrigadeDoubleSelects = new HashSet<TrainNoticeBrigadeDoubleSelect>(
			0);
	private Set<MessageOrgainze> messageOrgainzes = new HashSet<MessageOrgainze>(
			0);

	public TrainNoticePart() {
	}

	public TrainNoticePart(
			Organize organize,
			TrainNotice trainNotice,
			Date begintime,
			Date endtime,
			Byte state,
			Set<TrainNoticePartUserBaseInfo> trainNoticePartUserBaseInfos,
			Set<Teacher> teachers,
			Set<TrainNoticeBrigadeDoubleSelect> trainNoticeBrigadeDoubleSelects) {
		this.organize = organize;
		this.trainNotice = trainNotice;
		this.begintime = begintime;
		this.endtime = endtime;
		this.state = state;
		this.trainNoticePartUserBaseInfos = trainNoticePartUserBaseInfos;
		this.teachers = teachers;
		this.trainNoticeBrigadeDoubleSelects = trainNoticeBrigadeDoubleSelects;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ORGANIZE_ID")
	public Organize getOrganize() {
		return this.organize;
	}

	public void setOrganize(Organize organize) {
		this.organize = organize;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TRAIN_NOTICE_ID")
	public TrainNotice getTrainNotice() {
		return this.trainNotice;
	}

	public void setTrainNotice(TrainNotice trainNotice) {
		this.trainNotice = trainNotice;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "BEGINTIME", length = 19)
	public Date getBegintime() {
		return this.begintime;
	}

	public void setBegintime(Date begintime) {
		this.begintime = begintime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "ENDTIME", length = 19)
	public Date getEndtime() {
		return this.endtime;
	}

	public void setEndtime(Date endtime) {
		this.endtime = endtime;
	}

	@Column(name = "STATE")
	public Byte getState() {
		return this.state;
	}

	public void setState(Byte state) {
		this.state = state;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "trainNoticePart")
	public Set<TrainNoticePartUserBaseInfo> getTrainNoticePartUserBaseInfos() {
		return this.trainNoticePartUserBaseInfos;
	}

	public void setTrainNoticePartUserBaseInfos(
			Set<TrainNoticePartUserBaseInfo> trainNoticePartUserBaseInfos) {
		this.trainNoticePartUserBaseInfos = trainNoticePartUserBaseInfos;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "train_notice_part_teacher", joinColumns = { @JoinColumn(name = "TRAIN_NOTICE_PART_ID", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "TEACHER_ID", nullable = false, updatable = false) })
	public Set<Teacher> getTeachers() {
		return this.teachers;
	}

	public void setTeachers(Set<Teacher> teachers) {
		this.teachers = teachers;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "trainNoticePart")
	public Set<MessageRelatedPerson> getMessageRelatedPersons() {
		return this.messageRelatedPersons;
	}

	public void setMessageRelatedPersons(
			Set<MessageRelatedPerson> messageRelatedPersons) {
		this.messageRelatedPersons = messageRelatedPersons;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "trainNoticePart")
	public Set<TrainNoticeBrigadeDoubleSelect> getTrainNoticeBrigadeDoubleSelects() {
		return this.trainNoticeBrigadeDoubleSelects;
	}

	public void setTrainNoticeBrigadeDoubleSelects(
			Set<TrainNoticeBrigadeDoubleSelect> trainNoticeBrigadeDoubleSelects) {
		this.trainNoticeBrigadeDoubleSelects = trainNoticeBrigadeDoubleSelects;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "trainNoticePart")
	public Set<MessageOrgainze> getMessageOrgainzes() {
		return this.messageOrgainzes;
	}

	public void setMessageOrgainzes(Set<MessageOrgainze> messageOrgainzes) {
		this.messageOrgainzes = messageOrgainzes;
	}

}
